package com.a21200324.upalarm;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.LinearLayout;

public class SplashScreen extends Activity implements Animation.AnimationListener {

    private static final String TAG = "SplashScreen";

    private LinearLayout llUpAlarm;
    private TextViewCustomFont upTextView;
    private TextViewCustomFont alarmTextView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash_screen);

        upTextView = (TextViewCustomFont) findViewById(R.id.up_TextView);
        alarmTextView = (TextViewCustomFont) findViewById(R.id.alarm_TextView);

        upTextView.setCustomFont(this, AssetsDefines.FontsAssetsDefines.ROBOTO_ITALIC);
        alarmTextView.setCustomFont(this, AssetsDefines.FontsAssetsDefines.ROBOTO_LIGHT);

        llUpAlarm = (LinearLayout) findViewById(R.id.ll_UpAlarm);

        Animation fadeIn = AnimationUtils.loadAnimation(this, R.anim.fade_in);
        fadeIn.setAnimationListener(this);
        llUpAlarm.startAnimation(fadeIn);
    }

    @Override
    public void onAnimationStart(Animation animation) {
        Log.d(TAG, "onAnimationStart");
    }

    @Override
    public void onAnimationEnd(Animation animation) {
        Intent intent = new Intent(this, UpAlarm.class);
        startActivity(intent);
        finish();
    }

    @Override
    public void onAnimationRepeat(Animation animation) {
        Log.d(TAG, "onAnimationEnd");
    }
}
